# 进程之间可以通过Queue队列，或Pipe等进行通信
from multiprocessing import Queue, Process



def queue_put(q, item):
    q.put(item)

def queue_pop(q, size):
    item = q.get(True, size)
    print(item)
    return item

if __name__ == '__main__':
    q = Queue()
    p1 = Process(target=queue_put, args=(q, 'A'))
    p2 = Process(target=queue_pop, args=(q, 1))
    p1.start()
    p2.start()
    p1.join()
    p2.join()

